//
//  BHTUIBaseViewController.m
//  BigHealth
//
//  Created by 蔺百好 on 2021/9/8.
//

#import "BHTUIBaseViewController.h"
#import "THeader.h"
@interface BHTUIBaseViewController ()

@end

@implementation BHTUIBaseViewController


- (void)viewDidLoad {
    [super viewDidLoad];
   
    self.navigationController.navigationBarHidden = YES;
    
    [self.view addSubview:self.navigationBarView];
    
    self.navigationBarView.titleText = self.title;
    
    [self.navigationBarView.backBtn addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
    
    [self.navigationBarView.rightBtn addTarget:self action:@selector(rightAction) forControlEvents:UIControlEventTouchUpInside];
}

- (void)viewWillLayoutSubviews {
    [self.view bringSubviewToFront:self.navigationBarView];
}


- (void)backAction {
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)rightAction {
    
}

- (BHTUINavigationBarView *)navigationBarView {
    if (!_navigationBarView) {
        _navigationBarView = [BHTUINavigationBarView loadFromXib];
        _navigationBarView.frame = CGRectMake(0, 0, UIScreen.mainScreen.bounds.size.width, StatusBar_Height+44);
    }
    return  _navigationBarView;
}


@end
